import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

public class arq4 {

	public static void main(String args[]) throws IOException {

		Path arq = Paths.get("/tmp/banco.txt");
		if (!(Files.exists(arq))) {
			Files.createFile(arq);
		}
		/*
		 * System.out.println(Files.exists(arq));
		 * System.out.println(Files.isDirectory(arq));
		 * System.out.println(Files.isRegularFile(arq));
		 * System.out.println(Files.isReadable(arq));
		 * System.out.println(Files.isExecutable(arq));
		 * System.out.println(Files.size(arq));
		 * System.out.println(Files.getLastModifiedTime(arq));
		 * System.out.println(Files.getOwner(arq)); //Files.deleteIfExists(arq);
		 */

		Path destino = Paths.get("/tmp/pasta/pasta.txt");

		if (!(Files.exists(destino))) {
			System.out.println("Nãa existe, vou criar!");
			Files.createDirectory(destino.getParent());
			Files.createFile(destino);
			Files.deleteIfExists(destino);
			Files.write(destino,"Vamos brasil!!!".getBytes());
		}
		Path destino2 = Paths.get("/tmp/past/pasta.txt");
		if(!(Files.exists(destino2))){
		Files.createDirectory(destino2);
		}
		Files.copy(destino , destino2 ,StandardCopyOption.REPLACE_EXISTING);

		Path move = Paths.get("/tmp/movido");
		Files.move(destino2, move ,StandardCopyOption.REPLACE_EXISTING);
		/*
		 * System.out.println("Opção 1"); int escolha = 10;
		 * 
		 * for (int i = 2; i < 20; i++) { if (escolha == i) {
		 * System.out.println("Voce escolheu " + i); break; } }
		 */
	}
}
